<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>

</body>
<script type="text/javascript">
var num = prompt("输入数字：");

var num;

var s = num%2;

if(s == 0){
    window.alert("偶数");
}else{
    window.alert("奇数");
}

</script>
</html>